import React from 'react'

type Props = {}

function App({}: Props) {
  function fn(arry:number[]){
    let tem:number[]=[];
    arry.forEach((item,index)=>{
      if(tem.indexOf(item)==-1){
        tem.push(item)
      }
      
      console.log(tem);
    })
    // 11、正确实现数组去重后求和
    let sum=tem.reduce((perv:number,next:number)=>perv+next,0);
    return sum
    
    
  }console.log(fn([1,1,1,2,2,2,3]));

  
  
  return (
    <div>App</div>
  )
}

export default App